<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of customAdminFroms
 *
 * @author hodek
 */
class AdminFromsImp extends AdminFormsAbstract {
    
    protected static function getFFuploadAttach($dynData, $template = "uploadAttach") {
        $GLOBALS["editId"] = $dynData;
        return parse(loadTemplate(null, $template));
    }

    public static function getFFimageShowAndDelete($dynData) {
        $GLOBALS["editId"] = $dynData;
        return parse(loadTemplate(null, "imageShowAndDelete"));
    }

    public function editCatSpecial($special) {     
        if ($special == "games") {
            $content = "";
            $counter = 1;
            foreach (getAdminFrom() as $value) {
                switch ($counter) {
                    case 1:
                        $itemVisibility = $value;
                        break;
                    case 2:
                        $content .= AdminFormsAbstract::getFFText($value, true);
                        break;
                    case 3:
                        $content .= AdminFormsAbstract::getFFDate($value);
                        break;                 
                    case 5:
                        $content .= AdminFormsAbstract::getFFDivider();
                        $content .= AdminForms::getFFuploadAttach($value[1]);
                        $content .= '<div class="adminImagesBox adminImagesBox' . $value[1] . ' floatLeft" data-idcismap="' . $value[1] . '">';
                        $content .= '</div>';
                        break;
                    default:
                        $content .= AdminFormsAbstract::getFFDivider();
                        $content .= AdminFormsAbstract::getFFText($value);
                }
                $counter++;
            }
            $content = AdminFormsAbstract::getIcoEditFFLinkAndWindow($content, $special);
            $content .= AdminFormsAbstract::getVisibilityLink($itemVisibility);
            $content .= AdminFormsAbstract::getDelete($itemVisibility);
            return $content;
        }
        if ($special == "blog") {
            $content = "";
            $counter = 1;
            foreach (getAdminFrom() as $value) {
                switch ($counter) {
                    case 1:
                        $itemVisibility = $value;
                        break;
                    case 2:
                        $content .= AdminFormsAbstract::getFFText($value, true);
                        break;
                    case 3:
                        $content .= AdminFormsAbstract::getFFDate($value);
                        break;
                    case 4:
                        $content .= AdminFormsAbstract::getFFHidden($value);
                        break;
                    case 6:
                        $content .= AdminFormsAbstract::getFFDivider();
                        $content .= AdminForms::getFFuploadAttach($value[1]);
                        $content .= '<div class="adminImagesBox adminImagesBox' . $value[1] . ' floatLeft" data-idcismap="' . $value[1] . '">';
                        $content .= '</div>';
                        break;
                    default:
                        $content .= AdminFormsAbstract::getFFDivider();
                        $content .= AdminFormsAbstract::getFFText($value);
                }
                $counter++;
            }
            $content = AdminFormsAbstract::getIcoEditFFLinkAndWindow($content, $special);
            $content .= AdminFormsAbstract::getVisibilityLink($itemVisibility);
            $content .= AdminFormsAbstract::getDelete($itemVisibility);
            return $content;
        }
        if ($special == "banner") {
            $content = "";
            $counter = 1;
            foreach (getAdminFrom() as $value) {
                switch ($counter) {
                    case 1:
                        $content .= AdminForms::getFFuploadAttach($value[1], "uploadAttachFull");
                        $content .= '<div class="adminImagesBox adminImagesBox' . $value[1] . ' floatLeft" data-idcismap="' . $value[1] . '">';
                        $content .= '</div>';
                        break;
                    case 2:
                        $content .= AdminForms::getFFuploadAttach($value[1], "uploadAttachThumbnail");
                        $content .= '<div class="adminImagesBox adminImagesBox' . $value[1] . ' floatLeft" data-idcismap="' . $value[1] . '">';
                        $content .= '</div>';
                        break;
                }
                $counter++;
            }
            $content = AdminFormsAbstract::getIcoEditFFLinkAndWindow($content, $special);
            return $content;
        }
    }

    public function customForm($first = null, $second = null, $third = null) {
        if ($first == "banner") {
            $content = AdminForms::getFFuploadAttach($dynData);
            $content = AdminFormsAbstract::getIcoEditFFLinkAndWindow($content, "banner");
            return $tmp;
        }
    }

}

?>
